 ///
 /// @file    strategy.cc
 /// @author  lemon(haohb13@gmail.com)
 /// @date    2016-03-17 16:30:08
 ///
 
#include "strategy.h"
#include <iostream>
using std::cout;
using std::endl;

Context::Context(Strategy * strategy)
: _pStrategy(strategy)
{
	cout << "Context(Strategy*)" << endl;
}

Context::~Context()
{
	cout << "~Context()" << endl;
}

void Context::contextInterface()
{
	if(_pStrategy != NULL)
	{
		_pStrategy->algorithmInterface();
	}
}

void ConcreateStrategy::algorithmInterface()
{
	cout << "ConcreateStrategy implemented by ConcreateStrategy" << endl;
}

void ConcreateStrategyB::algorithmInterface()
{
	cout << "ConcreateStrategyB algorithm!" << endl;
}



